[% setvar title Selective interpolation in single quotish context. %]
<div id="archive-notice">
    <h3>This file is part of the Perl 6 Archive</h3>
    <p>To see what is currently happening visit <a href="http://www.perl6.org/">http://www.perl6.org/</a></p>
</div>
<div class='pod'>
<a name='TITLE'></a><h1>TITLE</h1>
<p>Selective interpolation in single quotish context.</p>
<a name='VERSION'></a><h1>VERSION</h1>
<pre>  Maintainer: Brad Hughes &lt;<a href='mailto:brad@tgsmc.com'>brad@tgsmc.com</a>&gt;
  Date: 14 Sep 2000
  Last Modified: 14 Sep 2000
  Mailing List: <a href='mailto:perl6-language@perl.org'>perl6-language@perl.org</a>
  Number: 226
  Version: 2
  Status: Developing</pre>
<a name='ABSTRACT'></a><h1>ABSTRACT</h1>
<p>Perl6 should allow scalars and arrays to be tagged such that they are
interpolated in single quotish context.</p>
<a name='DESCRIPTION'></a><h1>DESCRIPTION</h1>
<p>Single quotish context, such as <code>q{}</code>, <code>''</code>, and specified here-docs,
is especially useful for large blocks of text which may contain
the <code>$</code> and <code>@</code> characters.  Frequently, however, interpolation within
that large block of text is desired.  This RFC proposes that in single
quotish context scalars and arrays may be tagged to be interpolated.</p>
<p>As an example, on the VMS operating system the <code>$</code> runs rampant
through VMS namespaces, not to mention that each line of VMS' equivalent
of a Unix shell script (called a .com file) starts with a <code>$</code>, and execution
of VMS .com files is invoked with a <code>@</code>, resulting in backslashitis:</p>
<pre>        print F &lt;&lt;END;
        \$!
        \$! execute a.com, copy and purge
        \$!
        \$ \@sys\$login:a.com
        \$ copy $filename sys\$login:*.*
        \$ purge sys\$login:$filename
        \$!
        \$ exit
        END</pre>
<p>With this proposal, the scalar <code>$filename</code> can be tagged to be interpolated
by the <code>\I...\E</code> pair and the double quotish context replaced by single
quotish context resulting in the following:</p>
<pre>        print F &lt;&lt;'END';
        $!
        $! execute a.com, copy and purge
        $!
        $ @sys$login:a.com
        $ copy \I$filename\E sys$login:*.*
        $ purge sys$login:\I$filename\E
        $!
        $ exit
        END</pre>
<p>An array can be similarly tagged.  Would <code>\I&amp;subr\E</code> call subr?.</p>
<a name='IMPLEMENTATION'></a><h1>IMPLEMENTATION</h1>
<p>This wouldn't seem a difficult change to make.</p>
<a name='REFERENCES'></a><h1>REFERENCES</h1>
<p>Originally suggested in a different form by Jarkko Hietaniemi &lt;<a href='mailto:jhi@iki.fi'>jhi@iki.fi</a>&gt; in
&lt;archive address to follow&gt;, and seconded by Mark-Jason Dominus
&lt;<a href='mailto:mjd@plover.com'>mjd@plover.com</a>&gt; in &lt;archive address to follow&gt;.
Version 2 tag pair suggested by Damian Conway in &lt;...&gt;.</p>
</div>
